'use strict';
exports = module.exports = function($scope, $rootScope, $timeout, $alert, $state, $uibModal, yxtable14, $API) {
    // 搜索表单项
    $scope.obj = {
        // 下拉框搜索项: 时间段
        'begin': '',
        'end': '',
        // 下拉框搜索项: 关键字
        'keyWord': '',
        // 下拉框搜索项: 用户
        'username': '',
        // 下拉框搜索项: 分类
        'bizId': '',
        // 下拉框搜索项: 归档状态
        'archive': '',
        // 下拉框搜索项: 收入状态
        'incomeStatus': '',
        // 下拉框搜索项: 拆分状态
        'splitState': ''
    }
    // 初始化数据源
    $scope.dataSet = {
        'customer': select2Config( [] ), // 数据源: 用户列表
        'busiType': select2Config( [] ), // 数据源: 分类列表
        'archiveStatus': select2Config( [] ), // 数据源: 归档状态列表
        'incomeStatus': select2Config( [] ), // 数据源: 收入状态列表
        'splitStatus': select2Config( [] ), // 数据源: 拆分状态列表
    }
    // 表格数据
    $scope.yxt14loading = false; // 加载中
    $scope.page = 1; // 分页
    $scope.pagesize = 30;//每页显示条数，默认30条;
    $scope.yxt14totalrow = 999; // 总条数
    $scope.yxt14datalist = [];
    $scope.yxt14datasum = {};
    // 读接口
    $scope.showList = function() {
        $scope.yxt14loading = true;
        var data = {
            "list":[
                {"date":"1975-06-17","archiveDate":"1976-04-23","userName":"邵刚","bizName":"加生加造并速使山清路具但后且使山清路具但后且使山清路具但后且使山清路具但后且使山清路具但后且使山清路具但后且建。","adId":9568,"url":"cid://qezimqkp.lb/ultdkkjg","uvCount":4254,"uvAdjustCount":8018,"price":3632.92,"amount":1412.76,"xxx":9000.82,"incomeType":0,"archiveState":0,"splitState":0,"$$hashKey":"object:752"},
                {"date":"1980-03-13","archiveDate":"1980-05-18","userName":"袁秀兰","bizName":"住示中支其往们算以世也准边江们算以世也准边江们算以世也准边江们算以世也准边江们算以世也准边江重领。","adId":7044,"url":"tn3270://jymr.mn/vrxtq","uvCount":8734,"uvAdjustCount":9315,"price":4012.87,"amount":6836.85,"xxx":2868.43,"incomeType":1,"archiveState":0,"splitState":1,"$$hashKey":"object:753"},
                {"date":"1997-12-20","archiveDate":"2012-11-27","userName":"郑洋","bizName":"此料片新已切区史他声干市报。","adId":8107,"url":"telnet://qikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lkqikj.lk/bmyqj","uvCount":2737,"uvAdjustCount":4780,"price":2000.77,"amount":5698.74,"xxx":9700.66,"incomeType":1,"archiveState":1,"splitState":1,"$$hashKey":"object:754"}
            ],
            "rowcount":90,
            "sumDate":{"uvCountSum":5132,"uvAdjustCountSum":8837,"amountSum":7081.42}
        }
        $scope.yxt14datalist = data.list;
        // $scope.yxt14totalrow = data.rowcount;
        $scope.yxt14totalrow = undefined; //测试一下接口没有返回此字段是否触发不分页逻辑
        $scope.yxt14datasum = data.sumDate;
        $scope.yxt14loading = false;
    }
    // 初始化
    yxtable14.init($scope);
}
